package com.yidu.InventoryManagement.service.impl;

import com.yidu.CashManagement.entity.FundsAllot;
import com.yidu.InventoryManagement.entity.*;
import com.yidu.InventoryManagement.mapper.ShouYiZhiFuMapper;
import com.yidu.InventoryManagement.service.ShouYiZhiFuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 梁俊
 * @date 2022/12/12
 * &@version 1.0
 */
@Service
public class ShouYiZhiFuServiceImpl implements ShouYiZhiFuService {
    @Autowired
    public ShouYiZhiFuMapper shouYiZhiFuMapper;

    @Override
    public List<XianJinLiXi> selectShouYiZhiFu(String date1,String date, int page, int limit) {
        Map map=new HashMap();
        map.put("date1",date1);
        map.put("date",date);
        map.put("page",(page-1)*limit);
        map.put("limit",limit);
        return shouYiZhiFuMapper.selectShouYiZhiFu(map);
    }

    @Override
    public int selectXianJinLiXii(String date) {
        return shouYiZhiFuMapper.selectXianJinLiXii(date);
    }

    @Override
    public int deleteCashAccruedd(String businessTime, int businessType, int money) {
        return shouYiZhiFuMapper.deleteCashAccruedd(businessTime,businessType,money);
    }

    @Override
    public int deletesecurityAccruedd(String businessTime, int businessType, int money) {
        return shouYiZhiFuMapper.deletesecurityAccruedd(businessTime,businessType,money);
    }

    @Override
    public int deleteZiJingDiaoB(String businessTime, int allotType, int allotMoney) {
        return shouYiZhiFuMapper.deleteZiJingDiaoB(businessTime,allotType,allotMoney);
    }

    @Override
    public int selectShouYiZhuFuCount(String date) {
        return shouYiZhiFuMapper.selectShouYiZhuFuCount(date);
    }

    @Override
    public Integer selectShouYiZfuMoney(String date) {
        return shouYiZhiFuMapper.selectShouYiZfuMoney(date);
    }

    @Override
    public List<ZaiQuanLiXi> selectZhaiQuan(String date1,String date, int page, int limit) {
        Map map=new HashMap();
        map.put("date1",date1);
        map.put("date",'%'+date+'%');
        map.put("page",(page-1)*limit);
        map.put("limit",limit);


        return shouYiZhiFuMapper.selectZhaiQuan(map);
    }

    @Override
    public int selectZhaiQuanLixiShour(String date) {
        return shouYiZhiFuMapper.selectZhaiQuanLixiShour(date);
    }

    @Override
    public Integer selectZhaiQuanMoney(String date,int securityType) {
        return shouYiZhiFuMapper.selectZhaiQuanMoney(date,securityType);
    }

    @Override
    public int selectZhaiQuanCount(String date) {
        return shouYiZhiFuMapper.selectZhaiQuanCount('%'+date+'%');
    }

    @Override
    public List<ZfulFeng> selectZhiFu(String businessTime, int page, int limit) {
        Map map=new HashMap();
        map.put("businessTime",'%'+businessTime+'%');
        map.put("page",(page-1)*limit);
        map.put("limit",limit);
        return shouYiZhiFuMapper.selectZhiFu(map);
    }

   /* @Override
    public List<XianJinLiXi> selectZhiFu(String businessTime, int page, int limit) {
        Map map=new HashMap();
        map.put("businessTime","'%'+businessTime+'%'");
        map.put("page",(page-1)*limit);
        map.put("limit",limit);
        return shouYiZhiFuMapper.selectZhiFu(map);
    }*/

    @Override
    public int insertXianJinLiXi(CashAccrued cashAccrued) {
        return shouYiZhiFuMapper.insertXianJinLiXi(cashAccrued);
    }

    @Override
    public String selectDaXianJin() {
        return shouYiZhiFuMapper.selectDaXianJin();
    }

    @Override
    public int insertFundsAllot(FundsAllot fundAllot) {
        return shouYiZhiFuMapper.insertFundsAllot(fundAllot);
    }

    @Override
    public String selectZijinDiaoBo() {
        return shouYiZhiFuMapper.selectZijinDiaoBo();
    }

    @Override
    public String selectDaZhaiQuanId() {
        return shouYiZhiFuMapper.selectDaZhaiQuanId();
    }

    @Override
    public int insertSecurityAccrued(SecurityAccrued securityAccrued) {
        return shouYiZhiFuMapper.insertSecurityAccrued(securityAccrued);
    }
}

